<template>
   <div class="mt-4">
    <el-input
      v-model="input3"
      placeholder="搜索文件"
      class="input-with-select"
    >
      <template #append>
        <el-button :icon="Search" @click="search" />
      </template>

    </el-input>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { Search } from '@element-plus/icons-vue'
import {fileStore} from '@/stores/disk/file'
import {searchFile} from '@/api/disk/file'
const store = fileStore()
const input3 = ref('')


async function search() {
  store.updateCurrentPage(1)
  const data={
    value: input3.value,
    pageNum: store.state.currentPage,
    pageSize: store.state.pageSize,
  }
  const res= await searchFile(data)
  store.updateFileListBySearch(res.rows)
  const bread={
    name:'搜索'
  }
  store.updateCurrentBread(bread)
}
</script>

<style scoped>
.input-with-select .el-input-group__prepend {
  background-color: var(--el-fill-color-blank);
}
</style>